/** <a href="http://www.cpupk.com/decompiler">Eclipse Class Decompiler</a> plugin, Copyright (c) 2017 Chen Chao. **/
package com.minierp.dao.hibernate;

import com.minierp.dao.PayModeDao;
import com.minierp.dao.hibernate.BaseDaoImpl;
import java.util.List;

public class PayModeDaoImpl extends BaseDaoImpl implements PayModeDao {
	public List getList(boolean justEnabled) {
		String sql = "from com.minierp.model.PayMode c";
		if (justEnabled) {
			sql = sql + " where c.enabled=\'Y\'";
		}

		sql = sql + " order by c.sequenceCode";
		return this.getHibernateTemplate().find(sql);
	}

	public int getMaxSequenceCode() {
		String sql = "select max(c.sequenceCode) from com.minierp.model.PayMode c";
		List list = this.getHibernateTemplate().find(sql);
		return !list.isEmpty() && list.get(0) != null ? Integer.parseInt(list
				.get(0).toString()) : 0;
	}
}